<?php

namespace app\erp\model;

use think\Model;

class UGoodsdb extends Model
{
    protected $connection = 'database.utec_db';
    protected $pk = 'goods_id';
    protected $name = 'goods';

    public function chkGoods($goods_id)
    {
        return true;
        /*$goodsdb = new Goodsdb();
        $get_goods = $goodsdb->find($goods_id);
        if(!$get_goods){
            return false;
        }
        $chk_goods = $this->where('goods_sku', $get_goods['goods_sku'])->where('site_id', SITE_ID)->find();
        $get_goods = $get_goods->toArray();
        $get_goods['create_time'] = strtotime($get_goods['create_time']);
        $get_goods['update_time'] = strtotime($get_goods['update_time']);
        if ($chk_goods) {
            // 修改
            //$chk_goods->save($get_goods);
        } else {
            // 新增
            $this->save($get_goods);
        }
        $salePricedb = new SalePricedb();
        $get_sale_price = $salePricedb->where('goods_sku', $get_goods['goods_sku'])->select();
        $uSalePricedb = new USalePricedb();
        $uSalePricedb->saveSalePrice($get_goods['goods_sku'], $get_sale_price->toArray());

        return true;*/
    }
}